import { ProLayout } from '@ant-design/pro-components'
import { history, Outlet } from 'umi'
import defaultProps from './_defaultProps'

//框架配置
const BasicSetting = {
  title: '重庆市林业局图片信息库',
  // loading: true,
  onMenuHeaderClick: () => {
    history.push('/home')
  },
  menuItemRender: (item, dom) => (
    <div
      onClick={() => {
        history.push(dom.key)
      }}
      style={{
        display: 'flex',
        alignItems: 'center',
        gap: 8,
      }}>
      {dom}
    </div>
  ),
  logo: 'https://gw.alipayobjects.com/mdn/rms_b5fcc5/afts/img/A*1NHAQYduQiQAAAAAAAAAAABkARQnAQ',
  // menuHeaderRender: (logo, title) => (
  //   <div
  //     id="customize_menu_header"
  //     style={{
  //       height: '32px',
  //       display: 'flex',
  //       alignItems: 'center',
  //       gap: 8,
  //     }}>
  //     {logo}
  //     {title}
  //   </div>
  // ),
  ...defaultProps,
}

const BasicLayout = (props: any) => {
  return (
    <ProLayout layout="mix" {...BasicSetting}>
      {props.children}
      <Outlet />
    </ProLayout>
  )
}

export default BasicLayout
